﻿using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient.UI
{
	// Token: 0x0200172D RID: 5933
	internal class HeroBattleHandler : DlgHandlerBase
	{
		// Token: 0x170037B6 RID: 14262
		// (get) Token: 0x0600F4EF RID: 62703 RVA: 0x0037234C File Offset: 0x0037054C
		protected override string FileName
		{
			get
			{
				return "Battle/HeroBattleHandler";
			}
		}

		// Token: 0x0600F4F0 RID: 62704 RVA: 0x00372364 File Offset: 0x00370564
		protected override void Init()
		{
			base.Init();
			this._doc = XDocuments.GetSpecificDocument<XHeroBattleDocument>(XHeroBattleDocument.uuID);
			this._skillDoc = XDocuments.GetSpecificDocument<XHeroBattleSkillDocument>(XHeroBattleSkillDocument.uuID);
			this._doc._HeroBattleHandler = this;
			this.m_Death = base.transform.Find("Death").gameObject;
			this.m_Death.transform.localPosition = XGameUI.Far_Far_Away;
			this.m_ReviveLeftTime = (this.m_Death.transform.Find("LeftTime").GetComponent("XUILabel") as IXUILabel);
			this.m_ChangeHeroBtn = (this.m_Death.gameObject.transform.Find("ChangeHeroBtn").GetComponent("XUIButton") as IXUIButton);
			this.m_ProgressTs = base.transform.Find("Progress");
			this.m_ProgressTipsTs = base.transform.Find("TextTs");
			this.m_ProgressTs.localPosition = XGameUI.Far_Far_Away;
			this.m_ProgressTipsTs.localPosition = XGameUI.Far_Far_Away;
			this.m_Progress = (this.m_ProgressTs.Find("ProgressBar").GetComponent("XUIProgress") as IXUIProgress);
			this.m_AddTimeTs = base.transform.Find("AddTime");
			this.m_AddTimeTs.localPosition = XGameUI.Far_Far_Away;
			this.m_AddTimeProgress = (this.m_AddTimeTs.Find("AddtimeBar").GetComponent("XUIProgress") as IXUIProgress);
			this.m_ProgressTips = (base.transform.Find("TextTs/Text").GetComponent("XUILabel") as IXUILabel);
			this.m_ProgressTips.SetText(XStringDefineProxy.GetString("HeroBattleLoot"));
			GameObject gameObject = base.transform.Find("Score").gameObject;
			gameObject.SetActive(!XSingleton<XScene>.singleton.bSpectator);
			this.m_KillText = (base.transform.Find("Score/kill").GetComponent("XUILabel") as IXUILabel);
			this.m_DeadText = (base.transform.Find("Score/dead").GetComponent("XUILabel") as IXUILabel);
			this.m_AssitText = (base.transform.Find("Score/help").GetComponent("XUILabel") as IXUILabel);
			this.m_AttrShowBtn = (base.transform.Find("AttrShowBtn").GetComponent("XUISprite") as IXUISprite);
			this.m_AncientParent = base.transform.Find("AncientBarParent");
			this.m_AncientPercent = (base.transform.Find("AncientBarParent/AncientSkillBar/Num").GetComponent("XUILabel") as IXUILabel);
			this.m_AncientSlider = (base.transform.Find("AncientBarParent/AncientSkillBar").GetComponent("XUIProgress") as IXUIProgress);
			for (int i = 0; i < 3; i++)
			{
				this.m_AncientSkill[i] = (base.transform.Find(string.Format("AncientSkill/Skill{0}", i)).GetComponent("XUISprite") as IXUISprite);
				this.m_AncientSkill[i].ID = (ulong)((long)i + 1L);
				this.m_AncientSkill[i].RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAncientSkillClick));
				this.m_AncientSkill[i].SetVisible(false);
			}
			this._isAncientFull = false;
			this.SetAncientPercent(0f);
			this.m_AncientTipsBtn = (base.transform.Find("AncientBarParent/AncientSkillBar/Foreground").GetComponent("XUISprite") as IXUISprite);
			this.m_AncientTips = (base.transform.Find("AncientTips/Desc").GetComponent("XUILabel") as IXUILabel);
			this.m_AncientTipsCloseBtn = (base.transform.Find("AncientTips/Close").GetComponent("XUISprite") as IXUISprite);
			this.m_AncientTips.gameObject.transform.parent.gameObject.SetActive(false);
			this.m_Team.Clear();
			HeroBattleTeam item = new HeroBattleTeam(base.transform.Find("Scoreboard/BlueTeam"));
			HeroBattleTeam item2 = new HeroBattleTeam(base.transform.Find("Scoreboard/RedTeam"));
			this.m_Team.Add(item);
			this.m_Team.Add(item2);
			List<int> intList = XSingleton<XGlobalConfig>.singleton.GetIntList("HeroBattleBlueColor");
			this.blueColor = new Color((float)intList[0] / 255f, (float)intList[1] / 255f, (float)intList[2] / 255f);
			intList = XSingleton<XGlobalConfig>.singleton.GetIntList("HeroBattleRedColor");
			this.redColor = new Color((float)intList[0] / 255f, (float)intList[1] / 255f, (float)intList[2] / 255f);
			this._AddTimePerTurn = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("HeroBattleOverTime"));
			this._ReviveTime = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("HeroBattleReviveTime"));
			this._CurrentOccupant = 0U;
			this._InCircleMyself = false;
			this._IsInFight = false;
			this._ProgressTeam = 0U;
			this._LootProgress = 0f;
			this._MiniMapFxToken = 0U;
			this._InAddTime = false;
			this._OnDeath = false;
			this._HaveEnd = false;
			this.SetFx(0U);
			bool bSpectator = XSingleton<XScene>.singleton.bSpectator;
			if (bSpectator)
			{
				this.m_AncientSlider.SetVisible(false);
				base.transform.Find("MapSignalHandler").gameObject.SetActive(false);
				this.m_AttrShowBtn.SetVisible(false);
			}
			else
			{
				DlgHandlerBase.EnsureCreate<MapSignalHandler>(ref this.m_MapSignalHandler, base.transform.Find("MapSignalHandler").gameObject, this, true);
			}
		}

		// Token: 0x0600F4F1 RID: 62705 RVA: 0x00372944 File Offset: 0x00370B44
		public override void RegisterEvent()
		{
			base.RegisterEvent();
			this.m_ChangeHeroBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnChangeHeroBtnClick));
			this.m_AttrShowBtn.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAttrShowBtnClick));
			this.m_AncientTipsBtn.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAncientTipsBtnClick));
			this.m_AncientTipsCloseBtn.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAncientCloseBtnClick));
		}

		// Token: 0x0600F4F2 RID: 62706 RVA: 0x003729BC File Offset: 0x00370BBC
		public void OnAttrShowBtnClick(IXUISprite isp)
		{
			bool flag = XSingleton<XAttributeMgr>.singleton.XPlayerData == null;
			if (!flag)
			{
				uint num = 0U;
				this._doc.heroIDIndex.TryGetValue(XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID, out num);
				bool flag2 = num > 0U;
				if (flag2)
				{
					DlgBase<HeroAttrDlg, HeroAttrBehaviour>.singleton.ShowByType(SceneType.SCENE_HEROBATTLE, num);
				}
			}
		}

		// Token: 0x0600F4F3 RID: 62707 RVA: 0x00372A18 File Offset: 0x00370C18
		public override void OnUnload()
		{
			this._doc._HeroBattleHandler = null;
			XSingleton<XTimerMgr>.singleton.KillTimer(this.m_AncientTipsCloseToken);
			bool flag = this._Fx != null;
			if (flag)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._Fx, true);
				this._Fx = null;
			}
			bool flag2 = this._OccupantFx != null;
			if (flag2)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._OccupantFx, true);
				this._OccupantFx = null;
			}
			bool flag3 = this._EndFx != null;
			if (flag3)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._EndFx, true);
				this._EndFx = null;
			}
			bool flag4 = this._barFx != null;
			if (flag4)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._barFx, true);
				this._barFx = null;
			}
			for (int i = 0; i < this._skillFx.Length; i++)
			{
				bool flag5 = this._skillFx[i] != null;
				if (flag5)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(this._skillFx[i], true);
					this._skillFx[i] = null;
				}
			}
			bool bSpectator = XSingleton<XScene>.singleton.bSpectator;
			if (bSpectator)
			{
				XSpectateSceneDocument.DelMiniMapFx(this._MiniMapFxToken);
			}
			else
			{
				XBattleDocument.DelMiniMapFx(this._MiniMapFxToken);
			}
			bool flag6 = this.m_MapSignalHandler != null;
			if (flag6)
			{
				DlgHandlerBase.EnsureUnload<MapSignalHandler>(ref this.m_MapSignalHandler);
			}
			base.OnUnload();
		}

		// Token: 0x0600F4F4 RID: 62708 RVA: 0x0019F00C File Offset: 0x0019D20C
		protected override void OnShow()
		{
			base.OnShow();
		}

		// Token: 0x0600F4F5 RID: 62709 RVA: 0x00372B84 File Offset: 0x00370D84
		public void SetTeamData(HeroBattleTeamMsg data)
		{
			int num = (this._doc.MyTeam == data.teamdata[0].teamid) ? 0 : 1;
			this.m_Team[0].Score = data.teamdata[num].point;
			this.m_Team[1].Score = data.teamdata[1 - num].point;
			bool flag = !this._HaveEnd;
			if (flag)
			{
				bool flag2 = data.teamdata[0].point == 100U || data.teamdata[1].point == 100U;
				if (flag2)
				{
					this._HaveEnd = true;
					bool flag3 = data.teamdata[0].point == 100U;
					if (flag3)
					{
						this.SetResultFx(data.teamdata[0].teamid == this._doc.MyTeam);
					}
					else
					{
						this.SetResultFx(data.teamdata[1].teamid == this._doc.MyTeam);
					}
				}
			}
		}

		// Token: 0x0600F4F6 RID: 62710 RVA: 0x00372CB4 File Offset: 0x00370EB4
		public void SetResultFx(bool isWinMySelf)
		{
			HeroBattleMapCenter.RowData bySceneID = this._doc.HeroBattleMapReader.GetBySceneID(XSingleton<XScene>.singleton.SceneID);
			bool flag = bySceneID == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddErrorLog("Can't find hero battle map data by sceneID = ", XSingleton<XScene>.singleton.SceneID.ToString(), null, null, null, null);
			}
			else
			{
				Vector3 position = new Vector3(bySceneID.Center[0], bySceneID.Center[1], bySceneID.Center[2]);
				bool flag2 = this._EndFx != null;
				if (flag2)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(this._EndFx, true);
				}
				if (isWinMySelf)
				{
					this._EndFx = XSingleton<XFxMgr>.singleton.CreateFx(bySceneID.OccWinFx[0], null, true);
				}
				else
				{
					this._EndFx = XSingleton<XFxMgr>.singleton.CreateFx(bySceneID.OccWinFx[1], null, true);
				}
				this._EndFx.Play(position, Quaternion.identity, Vector3.one, 1f);
			}
		}

		// Token: 0x0600F4F7 RID: 62711 RVA: 0x00372DB8 File Offset: 0x00370FB8
		public void SetProgressData(HeroBattleSyncData data)
		{
			bool flag = this._IsInFight != data.isInFight;
			if (flag)
			{
				this.m_ProgressTips.SetText(XStringDefineProxy.GetString(data.isInFight ? "HeroBattleInFight" : "HeroBattleLoot"));
				this._IsInFight = data.isInFight;
			}
			bool flag2 = this._CurrentOccupant != data.occupant;
			int num;
			if (flag2)
			{
				num = ((this._doc.MyTeam == data.occupant) ? 0 : 1);
				this.m_Team[num].SetOccupantState(true);
				this.m_Team[1 - num].SetOccupantState(false);
				this._CurrentOccupant = data.occupant;
				this.SetFx(this._CurrentOccupant);
			}
			num = ((this._doc.MyTeam == data.lootTeam) ? 0 : 1);
			bool flag3 = this._ProgressTeam != data.lootTeam;
			if (flag3)
			{
				bool flag4 = data.lootTeam > 0U;
				if (flag4)
				{
					this.m_Progress.SetForegroundColor((num == 0) ? this.blueColor : this.redColor);
					this.m_Team[(this._ProgressTeam == this._doc.MyTeam) ? 0 : 1].SetOccupyValue(0f);
				}
				else
				{
					this.m_Team[(this._ProgressTeam == this._doc.MyTeam) ? 0 : 1].SetOccupyValue(0f);
					this.m_ProgressTs.localPosition = XGameUI.Far_Far_Away;
					this.m_ProgressTipsTs.localPosition = XGameUI.Far_Far_Away;
				}
				this._ProgressTeam = data.lootTeam;
			}
			bool flag5 = this._ProgressTeam > 0U;
			if (flag5)
			{
				this.m_Team[num].SetOccupyValue(data.lootProgress / 100f);
				this.m_Progress.value = data.lootProgress / 100f;
				this._LootProgress = data.lootProgress;
			}
			this.m_ProgressTs.localPosition = ((this._InCircleMyself && this._ProgressTeam != 0U && this._LootProgress > 0.5f) ? Vector3.zero : XGameUI.Far_Far_Away);
			this.m_ProgressTipsTs.localPosition = ((this._IsInFight || (this._InCircleMyself && this._ProgressTeam != 0U)) ? Vector3.zero : XGameUI.Far_Far_Away);
		}

		// Token: 0x0600F4F8 RID: 62712 RVA: 0x00373024 File Offset: 0x00371224
		public void SetInCircleData(HeroBattleInCircle data)
		{
			bool flag = false;
			bool bSpectator = XSingleton<XScene>.singleton.bSpectator;
			if (bSpectator)
			{
				flag = true;
			}
			else
			{
				for (int i = 0; i < data.roleInCircle.Count; i++)
				{
					bool flag2 = data.roleInCircle[i] == XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID;
					if (flag2)
					{
						flag = true;
					}
				}
			}
			bool flag3 = this._InCircleMyself != flag;
			if (flag3)
			{
				this._InCircleMyself = flag;
				this.m_ProgressTs.localPosition = ((this._InCircleMyself && this._ProgressTeam != 0U && this._LootProgress > 0.5f) ? Vector3.zero : XGameUI.Far_Far_Away);
			}
			this.m_ProgressTipsTs.localPosition = ((this._IsInFight || (this._InCircleMyself && this._ProgressTeam != 0U)) ? Vector3.zero : XGameUI.Far_Far_Away);
		}

		// Token: 0x0600F4F9 RID: 62713 RVA: 0x00373110 File Offset: 0x00371310
		public void StartAddTime(int time)
		{
			this._InAddTime = (time != 0);
			this._AddTimePerTurn = (float)time / 1000f;
			this.m_AddTimeTs.localPosition = (this._InAddTime ? Vector3.zero : XGameUI.Far_Far_Away);
			this._SignTime = Time.realtimeSinceStartup;
		}

		// Token: 0x0600F4FA RID: 62714 RVA: 0x00373161 File Offset: 0x00371361
		public void RefreshScoreBoard(uint kill, uint dead, uint assit)
		{
			this.m_KillText.SetText(kill.ToString());
			this.m_DeadText.SetText(dead.ToString());
			this.m_AssitText.SetText(assit.ToString());
		}

		// Token: 0x0600F4FB RID: 62715 RVA: 0x003731A0 File Offset: 0x003713A0
		public void SetFx(uint occupant)
		{
			HeroBattleMapCenter.RowData bySceneID = this._doc.HeroBattleMapReader.GetBySceneID(XSingleton<XScene>.singleton.SceneID);
			bool flag = bySceneID == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddErrorLog("Can't find hero battle map data by sceneID = ", XSingleton<XScene>.singleton.SceneID.ToString(), null, null, null, null);
			}
			else
			{
				Vector3 vector = new Vector3(bySceneID.Center[0], bySceneID.Center[1], bySceneID.Center[2]);
				float num = bySceneID.Param[0] * bySceneID.ClientFxScalse;
				float num2 = ((bySceneID.CenterType == 1U) ? bySceneID.Param[0] : bySceneID.Param[1]) * bySceneID.ClientFxScalse;
				Vector3 scale = new Vector3(num, 1f, num2);
				bool flag2 = this._Fx != null;
				if (flag2)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(this._Fx, true);
					this._Fx = null;
				}
				bool bSpectator = XSingleton<XScene>.singleton.bSpectator;
				if (bSpectator)
				{
					XSpectateSceneDocument.DelMiniMapFx(this._MiniMapFxToken);
				}
				else
				{
					XBattleDocument.DelMiniMapFx(this._MiniMapFxToken);
				}
				bool flag3 = occupant == 0U;
				if (flag3)
				{
					this._Fx = XSingleton<XFxMgr>.singleton.CreateFx(bySceneID.OccupantFx[0], null, true);
					bool bSpectator2 = XSingleton<XScene>.singleton.bSpectator;
					if (bSpectator2)
					{
						this._MiniMapFxToken = XSpectateSceneDocument.AddMiniMapFx(vector, bySceneID.MiniMapFx[0]);
					}
					else
					{
						this._MiniMapFxToken = XBattleDocument.AddMiniMapFx(vector, bySceneID.MiniMapFx[0]);
					}
				}
				else
				{
					bool flag4 = occupant == this._doc.MyTeam;
					if (flag4)
					{
						this._Fx = XSingleton<XFxMgr>.singleton.CreateFx(bySceneID.OccupantFx[1], null, true);
						bool bSpectator3 = XSingleton<XScene>.singleton.bSpectator;
						if (bSpectator3)
						{
							this._MiniMapFxToken = XSpectateSceneDocument.AddMiniMapFx(vector, bySceneID.MiniMapFx[1]);
						}
						else
						{
							this._MiniMapFxToken = XBattleDocument.AddMiniMapFx(vector, bySceneID.MiniMapFx[1]);
						}
					}
					else
					{
						this._Fx = XSingleton<XFxMgr>.singleton.CreateFx(bySceneID.OccupantFx[2], null, true);
						bool bSpectator4 = XSingleton<XScene>.singleton.bSpectator;
						if (bSpectator4)
						{
							this._MiniMapFxToken = XSpectateSceneDocument.AddMiniMapFx(vector, bySceneID.MiniMapFx[2]);
						}
						else
						{
							this._MiniMapFxToken = XBattleDocument.AddMiniMapFx(vector, bySceneID.MiniMapFx[2]);
						}
					}
				}
				this._Fx.Play(vector, Quaternion.identity, scale, 1f);
				bool flag5 = occupant > 0U;
				if (flag5)
				{
					bool flag6 = this._OccupantFx != null;
					if (flag6)
					{
						XSingleton<XFxMgr>.singleton.DestroyFx(this._OccupantFx, true);
					}
					bool flag7 = occupant == this._doc.MyTeam;
					if (flag7)
					{
						this._OccupantFx = XSingleton<XFxMgr>.singleton.CreateFx(bySceneID.OccSuccessFx[0], null, true);
					}
					else
					{
						this._OccupantFx = XSingleton<XFxMgr>.singleton.CreateFx(bySceneID.OccSuccessFx[1], null, true);
					}
					this._OccupantFx.Play(vector, Quaternion.identity, scale, 1f);
				}
			}
		}

		// Token: 0x0600F4FC RID: 62716 RVA: 0x00373494 File Offset: 0x00371694
		private bool OnChangeHeroBtnClick(IXUIButton btn)
		{
			bool flag = this._skillDoc.m_HeroBattleSkillHandler != null;
			if (flag)
			{
				this._skillDoc.m_HeroBattleSkillHandler.SetVisible(true);
				this._skillDoc.m_HeroBattleSkillHandler.RefreshTab();
			}
			return true;
		}

		// Token: 0x0600F4FD RID: 62717 RVA: 0x003734DE File Offset: 0x003716DE
		public void SetDeathGoState(bool state)
		{
			this.m_Death.gameObject.transform.localPosition = (state ? Vector3.zero : XGameUI.Far_Far_Away);
		}

		// Token: 0x0600F4FE RID: 62718 RVA: 0x00373506 File Offset: 0x00371706
		public void SetReviveLeftTime()
		{
			this._OnDeath = true;
			this._ReviveSignTime = Time.realtimeSinceStartup;
		}

		// Token: 0x0600F4FF RID: 62719 RVA: 0x0037351C File Offset: 0x0037171C
		public override void OnUpdate()
		{
			bool inAddTime = this._InAddTime;
			if (inAddTime)
			{
				float num = Time.realtimeSinceStartup - this._SignTime;
				this.m_AddTimeProgress.value = 1f - num / this._AddTimePerTurn;
				bool flag = num > this._AddTimePerTurn;
				if (flag)
				{
					this._InAddTime = false;
					this.m_AddTimeTs.localPosition = XGameUI.Far_Far_Away;
				}
			}
			bool onDeath = this._OnDeath;
			if (onDeath)
			{
				float num = Time.realtimeSinceStartup - this._ReviveSignTime;
				int num2 = (int)(this._ReviveTime - num);
				this.m_ReviveLeftTime.SetText(num2.ToString());
				bool flag2 = this._ReviveTime - num < 0f;
				if (flag2)
				{
					this._OnDeath = false;
				}
			}
		}

		// Token: 0x0600F500 RID: 62720 RVA: 0x003735D8 File Offset: 0x003717D8
		private void PlayShowSkillFx()
		{
			bool flag = this._barFx != null;
			if (flag)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._barFx, true);
			}
			this._barFx = XSingleton<XFxMgr>.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_yxxg_jindutiao", this.m_AncientParent, false);
			for (int i = 0; i < 3; i++)
			{
				bool flag2 = this._skillFx[i] != null;
				if (flag2)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(this._skillFx[i], true);
				}
				switch (i)
				{
				case 0:
					this._skillFx[i] = XSingleton<XFxMgr>.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_yxxg_tubiao_hong", this.m_AncientSkill[i].transform, false);
					break;
				case 1:
					this._skillFx[i] = XSingleton<XFxMgr>.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_yxxg_tubiao_lan", this.m_AncientSkill[i].transform, false);
					break;
				case 2:
					this._skillFx[i] = XSingleton<XFxMgr>.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_yxxg_tubiao_lu", this.m_AncientSkill[i].transform, false);
					break;
				}
			}
		}

		// Token: 0x0600F501 RID: 62721 RVA: 0x003736EC File Offset: 0x003718EC
		protected void DestroyShowSkillFx(object o)
		{
			GameObject o2 = o as GameObject;
			XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroy(o2, true, false);
		}

		// Token: 0x0600F502 RID: 62722 RVA: 0x0037370F File Offset: 0x0037190F
		private void OnAncientSkillClick(IXUISprite iSp)
		{
			this._doc.QueryUseAncientSkill((int)iSp.ID);
		}

		// Token: 0x0600F503 RID: 62723 RVA: 0x00373728 File Offset: 0x00371928
		public void SetAncientPercent(float percent)
		{
			bool flag = percent > 99.99f;
			if (flag)
			{
				percent = 100f;
			}
			bool flag2 = percent == 100f;
			bool flag3 = flag2 != this._isAncientFull;
			if (flag3)
			{
				for (int i = 0; i < 3; i++)
				{
					this.m_AncientSkill[i].SetVisible(flag2);
				}
				this.m_AncientSlider.SetVisible(!flag2);
				bool flag4 = flag2;
				if (flag4)
				{
					this.PlayShowSkillFx();
				}
				this._isAncientFull = flag2;
				bool flag5 = flag2;
				if (flag5)
				{
					this.OnAncientCloseBtnClick(null);
				}
			}
			this.m_AncientSlider.value = percent / 100f;
			this.m_AncientPercent.SetText(string.Format("{0}%", (int)(percent + 0.49f)));
		}

		// Token: 0x0600F504 RID: 62724 RVA: 0x003737F0 File Offset: 0x003719F0
		public void OnAncientTipsBtnClick(IXUISprite iSp)
		{
			this.m_AncientTips.gameObject.transform.parent.gameObject.SetActive(true);
			this.m_AncientTips.SetText(XSingleton<UiUtility>.singleton.ReplaceReturn(XStringDefineProxy.GetString("HeroBattleAncientTips")));
			this.m_AncientTipsCloseToken = XSingleton<XTimerMgr>.singleton.SetTimer(5f, new XTimerMgr.ElapsedEventHandler(this.AutoClose), null);
		}

		// Token: 0x0600F505 RID: 62725 RVA: 0x00373861 File Offset: 0x00371A61
		public void AutoClose(object o = null)
		{
			this.OnAncientCloseBtnClick(null);
		}

		// Token: 0x0600F506 RID: 62726 RVA: 0x0037386C File Offset: 0x00371A6C
		public void OnAncientCloseBtnClick(IXUISprite iSp)
		{
			this.m_AncientTips.gameObject.transform.parent.gameObject.SetActive(false);
			XSingleton<XTimerMgr>.singleton.KillTimer(this.m_AncientTipsCloseToken);
		}

		// Token: 0x040069C9 RID: 27081
		private XHeroBattleDocument _doc = null;

		// Token: 0x040069CA RID: 27082
		private XHeroBattleSkillDocument _skillDoc = null;

		// Token: 0x040069CB RID: 27083
		private List<HeroBattleTeam> m_Team = new List<HeroBattleTeam>();

		// Token: 0x040069CC RID: 27084
		private GameObject m_Death;

		// Token: 0x040069CD RID: 27085
		private IXUILabel m_ReviveLeftTime;

		// Token: 0x040069CE RID: 27086
		private Transform m_ProgressTs;

		// Token: 0x040069CF RID: 27087
		private IXUILabel m_ProgressTips;

		// Token: 0x040069D0 RID: 27088
		private Transform m_ProgressTipsTs;

		// Token: 0x040069D1 RID: 27089
		private IXUIProgress m_Progress;

		// Token: 0x040069D2 RID: 27090
		private Transform m_AddTimeTs;

		// Token: 0x040069D3 RID: 27091
		private IXUIProgress m_AddTimeProgress;

		// Token: 0x040069D4 RID: 27092
		private IXUIButton m_ChangeHeroBtn;

		// Token: 0x040069D5 RID: 27093
		private IXUILabel m_KillText;

		// Token: 0x040069D6 RID: 27094
		private IXUILabel m_DeadText;

		// Token: 0x040069D7 RID: 27095
		private IXUILabel m_AssitText;

		// Token: 0x040069D8 RID: 27096
		private Transform m_AncientParent;

		// Token: 0x040069D9 RID: 27097
		private IXUILabel m_AncientPercent;

		// Token: 0x040069DA RID: 27098
		private IXUIProgress m_AncientSlider;

		// Token: 0x040069DB RID: 27099
		private IXUISprite[] m_AncientSkill = new IXUISprite[3];

		// Token: 0x040069DC RID: 27100
		private bool _isAncientFull;

		// Token: 0x040069DD RID: 27101
		private IXUISprite m_AttrShowBtn;

		// Token: 0x040069DE RID: 27102
		private IXUISprite m_AncientTipsBtn;

		// Token: 0x040069DF RID: 27103
		private IXUISprite m_AncientTipsCloseBtn;

		// Token: 0x040069E0 RID: 27104
		private IXUILabel m_AncientTips;

		// Token: 0x040069E1 RID: 27105
		private uint m_AncientTipsCloseToken;

		// Token: 0x040069E2 RID: 27106
		private Color blueColor;

		// Token: 0x040069E3 RID: 27107
		private Color redColor;

		// Token: 0x040069E4 RID: 27108
		private XFx _Fx;

		// Token: 0x040069E5 RID: 27109
		private XFx _OccupantFx;

		// Token: 0x040069E6 RID: 27110
		private XFx _EndFx;

		// Token: 0x040069E7 RID: 27111
		private uint _MiniMapFxToken;

		// Token: 0x040069E8 RID: 27112
		private uint _CurrentOccupant;

		// Token: 0x040069E9 RID: 27113
		private bool _InCircleMyself;

		// Token: 0x040069EA RID: 27114
		private bool _IsInFight;

		// Token: 0x040069EB RID: 27115
		private uint _ProgressTeam;

		// Token: 0x040069EC RID: 27116
		private bool _InAddTime;

		// Token: 0x040069ED RID: 27117
		private float _AddTimePerTurn;

		// Token: 0x040069EE RID: 27118
		private float _SignTime;

		// Token: 0x040069EF RID: 27119
		private bool _OnDeath;

		// Token: 0x040069F0 RID: 27120
		private float _ReviveTime;

		// Token: 0x040069F1 RID: 27121
		private float _ReviveSignTime;

		// Token: 0x040069F2 RID: 27122
		private float _LootProgress;

		// Token: 0x040069F3 RID: 27123
		private bool _HaveEnd;

		// Token: 0x040069F4 RID: 27124
		private XFx[] _skillFx = new XFx[3];

		// Token: 0x040069F5 RID: 27125
		private XFx _barFx;

		// Token: 0x040069F6 RID: 27126
		public MapSignalHandler m_MapSignalHandler;
	}
}
